$wgLogQueries = false;
$wgUseBetterLinksUpdate = true;
+# If wgWhitelistEdit is set to true, only logged in users
+# are allowed to edit articles.
+# $wgWhitelistEdit = true;
# Client-side caching:
$wgCachePages = true; # Allow client-side caching of pages
function edit()
{
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgWhitelistEdit;
global $wpTextbox1, $wpSummary, $wpSave, $wpPreview;
global $wpMinoredit, $wpEdittime, $wpTextbox2;
$this->blockedIPpage();
return;
}
+ if ( !$wgUser->getID() && $wgWhitelistEdit ) {
+ $this->userNotLoggedInPage();
+ return;
+ }
if ( wfReadOnly() ) {
if( isset( $wpSave ) or isset( $wpPreview ) ) {
$this->editForm( "preview" );
$this->blockedIPpage();
return;
}
+ if ( !$wgUser->getID() && $wgWhitelistEdit ) {
+ $this->userNotLoggedInPage();
+ return;
+ }
if ( wfReadOnly() ) {
$wgOut->readOnlyPage();
return;
}
+
+ function userNotLoggedInPage()
+ {
+ global $wgOut, $wgUser, $wgLang;
+
+ $wgOut->setPageTitle( wfMsg( "whitelistedittitle" ) );
+ $wgOut->setRobotpolicy( "noindex,nofollow" );
+ $wgOut->setArticleFlag( false );
+
+ $wgOut->addWikiText( wfMsg( "whitelistedittext" ) );
+ $wgOut->returnToMain( false );
+ }
+
+
}
?>
"blockedtext" => "Your user name or IP address has been blocked by $1.
The reason given is this:<br>''$2''<p>You may contact $1 or one of the other
[[Wikipedia:administrators|administrators]] to discuss the block.",
+"whitelistedittitle" => "User not logged in",
+"whitelistedittext" => "You have to [[Spezial:Userlogin|login]] to edit articles.",
"newarticle" => "(New)",
"newarticletext" =>
"You've followed a link to a page that doesn't exist yet.